package 基础语法.权限修饰符.包1;

public class Test2 {
public static void main(String[] args) {
    Test1 test1=new Test1();
    test1.naDMethod();
    test1.protectedMethod();
    test1.finalMethod();

   // Test1_2 test1_2=new Test1_2() //抽象类只允许被继承，不允许创建
    
}
}

class tt extends Test1 {
        //@Override  void publicMethod() { }//不可以
    @Override public void publicMethod() { }
    //@Override public static void main(String[] a) {}
    //@Override void protectedMethod() {}//不可以
     @Override protected  void protectedMethod() {}
    //@Override protected  final void protectedMethod() {}//可以
    // @Override public void protectedMethod() {}//可以提升
    //@Override private void protectedMethod() {}//不可以降低

    @Override
    void naDMethod() {

    }

    //@Override private void privateDMethod() {}

    //@Override public final void finalMethod() {}
}

class tt1 extends Test1_1{
    @Override protected void protectedMethod() {}

    @Override void naDMethod() {}
     @Override public void publicMethod() {}

    //@Override private void privateDMethod() {}

    //@Override public final void finalMethod() {}
}
class tt2 extends Test1_2{
     tt2(int a) {//父类若没有无参构造，则子类必须提供一个与之对应的构造器，并调用super()
        super(a);
    }

     @Override protected void protectedMethod() {}

    @Override
    void naDMethod() {}

    @Override
    void jiji() {
        // TODO Auto-generated method stub
        throw new UnsupportedOperationException("Unimplemented method 'jiji'");
    }

    //@Override private void privateDMethod() {}

    //@Override public final void finalMethod() {}
}

//class tt3 extends Test1_3{}//报错，不允许继承